package com.mapbased.cc.valid;

import com.mapbased.wfw.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy_hs(Baily)
 * @version 1.0
 */
public class MultiValidator
    implements Validator
{
    final Validator[] validators;
    public MultiValidator(Validator[] validators)
    {
        this.validators=validators;
    }

    /**
     *
     * @param value String
     * @param rc RenderContext
     * @return boolean
     * @todo Implement this com.mapbased.cc.valid.Validator method
     */
    public boolean isValid(String value,RenderContext rc)
    {
        for(int i=0;i < this.validators.length;i++)
        {
            if(this.validators[i] == null)
            {
                continue;
            }
            if(!this.validators[i].isValid(value,rc))
            {
                return false;
            }
        }
        return true;
    }

    public String toString()
    {
        return "格式不正确!";
    }

}
